import 'package:flutter/material.dart';
import 'package:v10/key_widget/util/UniqueColorGenerator.dart';

class StatefulColorfulTile extends StatefulWidget {
  Color defaultColor;

  StatefulColorfulTile({Key key, this.defaultColor}) : super(key: key) {
    if (defaultColor == null) {
      this.defaultColor = UniqueColorGenerator().getColor();
    }
  }

  @override
  StatefulColorfulTileState createState() => StatefulColorfulTileState();
}

class StatefulColorfulTileState extends State<StatefulColorfulTile> {
  StatefulColorfulTileState();

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 100,
      width: 100,
      child: Container(
        color: widget.defaultColor,
        child: Text("$hashCode"),
      ),
    );
  }
}
